package kechengsheji.manag;

import gongju.Communtil;
import gongju.JDBC;
import gongju.User;

import java.util.ArrayList;
import java.util.List;

//主管
public class ManagDAO {
    //属性
    public static final Object[] columnNames = {"ID","主管名","密码"};
    public static User getUser(String name){
        String sql = "select id,name,password from manag where name=?";
        List param = new ArrayList();
        param.add(name);
        Object[] obj = JDBC.queryObject(sql, param,3);
        if(obj == null){
            return null;
        }
        User user = new User();
        user.setId((int)obj[0]);
        user.setUsername((String)obj[1]);
        user.setPassword((String)obj[2]);
        user.setType(1);
        return user;
    }
}
